package com.zhentao.controller;



import com.zhentao.common.enums.admin.AdNotice;

import com.zhentao.common.enums.dto.AdNoticeDto;
import com.zhentao.dtos.Result;
import com.zhentao.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@RequestMapping("notice/v1")
public class NoticeController {
    @Autowired
    private NoticeService noticeService;

//    @PostMapping("list")
//    public ResponseResult noticelist(){
//        ResponseResult list = noticeService.();
//        return list;
//    }

    /**
     *  公告列表
     * @param adNoticeDto
     * @return
     */
    @RequestMapping(value ="/notice/AdNoticeList" ,method = RequestMethod.POST)
    private Result list(@RequestBody AdNoticeDto adNoticeDto){
        return noticeService.noticeList(adNoticeDto);
    }

    @RequestMapping(value = "/notice/AdNoticeAdd",method = RequestMethod.PUT)
    private Result addOrUpd(@RequestBody AdNotice adNotice){
        return noticeService.noticeAddOrUpd(adNotice);
    }

    @RequestMapping(value = "/notice/AdNoticeDel",method = RequestMethod.DELETE)
    private Result del( Integer id){
        return noticeService.noticeDelete(id);
    }

}
